<template>
  <div class="plate-content">
    <div class="top" data-title="江都建设当年销售额">
      <img src="~@/assets/image/plate.png" alt="">
    </div>
    <!-- <div class="trapezoid">江都建设累计销售额</div> -->
    <div class="center">
      <div class="banner">
        <div class="board" v-for="item in saleAmount()">
          <div class="banner-list" v-if="item !== '.'">
            {{ item }}
            <div class="line"></div>
          </div>
          <div class="banner-spot" v-else></div>
        </div>
      </div>
      <div class="num">{{toNumsaleAmount()||'零'}}</div>
    </div>
    <div class="bottom">
      <div class="bottom-list">
        <label>{{toFixedTwo(titleList.currMonthIncome)}}</label>
        <span>本月新增收入(万)</span>
      </div>
      <div class="bottom-list">
        <label>{{toFixedTwo(titleList.currYearIncome)}}</label>
        <span>今年累计收入(万)</span>
      </div>
      <div class="bottom-list">
        <label>{{toFixedTwo(titleList.yearProfile)}}</label>
        <span>今年累计利润(万)</span>
      </div>
    </div>
  </div>
</template>

<script>
import numberToUpper from "@/utils/numberToUpper"
export default {
  name: "vi-plate",
  props:{
    titleList:{
      default:{
        saleAmount:"",
        currMonthIncome:"",
        currYearIncome:"",
        yearProfile:"",
      },
    },
  },
  methods:{
    toFixedTwo(msg){
      if(!msg){
        return '--'
      }else{
        return (Number(msg)/10000).toFixed(2)
      }
    },
    saleAmount(){
      return String((this.titleList.saleAmount/10000).toFixed(2))||'0'
    },
    toNumsaleAmount(){
      return numberToUpper((this.titleList.saleAmount/10000).toFixed(2)*10000||0)
    },
  },
};
</script>

<style lang="scss" scoped>
@import "../styles/plate.scss";
</style>
